package com.leesche.netdoll.communication.entity;

import java.util.HashMap;
import java.util.Map;

public class GameStatusCode {

	/** 尝试开始新游戏 */
	public final static int GS_TRY = 1000;

	/** 开始新游戏成功 */
	public final static int GS_TRY_SUCESS = 1001;

	/** 开始新游戏失败 */
	public final static int GS_TRY_FAILED = 1002;

	/** 开始必中局 */
	public final static int GS_START_WITH_PRIZE = 1003;
	
	/** 篮球机得分 */
	public final static int GS_START_RESULT = 10031;

	/** 开始不中局 */
	public final static int GS_START_WITHOUT_PRIZE = 1004;

	/** 不中局结束，结果不中 */
	public final static int GS_END_WITHOUT_PRIZE_NORMAL = 1005;

	/** 必中局结束，结果中奖 */
	public final static int GS_END_WITH_PRIZE__NORMAL = 1006;

	/** 必中局结束，结果不中 */
	public final static int GS_END_WITH_PRIZE_ABNORMAL = 1007;

	/** 不中局结束，结果中奖 */
	public final static int GS_END_WITHOUT_PRIZE_ABNORMAL = 1008;

	/** 保送用完，结果不中，结束 */
	public final static int GS_END_RPOMISE = 1009;

	/** 网络故障，结束 */
	public final static int GS_END_NET_EXCEPTION = 9999;

	private final static Map<Integer, Integer> MACHINE_CODE = new HashMap<>();

	static {
		MACHINE_CODE.put(0x01, GS_START_WITH_PRIZE);
		MACHINE_CODE.put(0x02, GS_START_WITHOUT_PRIZE);
		MACHINE_CODE.put(0x81, GS_END_WITHOUT_PRIZE_NORMAL);
		MACHINE_CODE.put(0x82, GS_END_WITH_PRIZE__NORMAL);
		MACHINE_CODE.put(0x83, GS_END_WITH_PRIZE_ABNORMAL);
		MACHINE_CODE.put(0x84, GS_END_WITHOUT_PRIZE_ABNORMAL);
		MACHINE_CODE.put(0x85, GS_END_RPOMISE);
	}

	public static int fromMachineCode(int code) {
		return MACHINE_CODE.get(code);
	}

}
